package ModelLayer;
import java.util.ArrayList;


/**
 * This class creates an object of type Person.
 * 
 * @author (group 1(A)) 
 * @version (14-04-2011)
 */
public class Person
{
    // instance variables for the class Person
    private int id;
    private String name;
    private String address;
    private int zipCode;
    private String city;
    private int phoneNumber;
    private Loan loan;
    private ArrayList<Loan> loans;

    /**
     * Constructor for objects of class Person
     * @param id Id of the person
     * @param name Name of the person
     * @param address The persons address
     * @param zipCode The persons ZIP Code
     * @param city The persons city
     * @param phoneNumber Phone number of the person
     */
    public Person(int id, String name, String address, int zipCode, String city, int phoneNumber)
    {
        this.id = id;
        this.name = name;
        this.address = address;
        this.zipCode = zipCode;
        this.city = city;
        this.phoneNumber = phoneNumber;
        loans = new ArrayList<Loan>();
    }
    
    /**
     * Set the persons id
     * @param id Id of the person
     */
    public void setId(int id)
    {
        this.id = id;
    }
    
    /**
     * Return the persons id
     */
    public int getId()
    {
        return id;
    }
    
    /**
     * Set the persons name
     * @param name Name of the person
     */
    public void setName(String name)
    {
        this.name = name;
    }
    
    /**
     * Return the persons name
     */
    public String getName()
    {
        return name;
    }
    
    /**
     * Set the persons address
     * @param address The persons address
     */
    public void setAddress(String address)
    {
        this.address = address;
    }
    
    /**
     * Return the persons name
     */
    public String getAddress()
    {
        return address;
    }
    
    /**
     * Set the persons zipCode
     * @param zipCode The persons ZIP Code
     */
    public void setZipCode(int zipCode)
    {
        this.zipCode = zipCode;
    }
    
    /**
     * Return the persons zipcode
     */
    public int getZipCode()
    {
        return zipCode;
    }
    
    /**
     * Set the persons city
     * @param city The persons city
     */
    public void setCity(String city)
    {
        this.city = city;
    }
    
    /**
     * Return the persons city
     */
    public String getCity()
    {
        return city;
    }
    
    /**
     * Set the persons phone number
     * @param phoneNumber Phone number of the person
     */
    public void setPhoneNumber(int phoneNumber)
    {
        this.phoneNumber = phoneNumber;
    }
    
    /**
     * Return the persons phone number
     */
    public int getPhoneNumber()
    {
        return phoneNumber;
    }
    
    /**
     * Creates a loan
     * @param id Id the of the person
     * @param status Status of the loan
     * @param serialNumber Serial number of the copy
     * @param getDate Purchase date of the copy
     * @param getPrice Purchase price of the copy
     * @return Returns an arraylist
     */
    public ArrayList<Loan> createLoan(int id, int date, int periode, boolean status, int serialNumber, int getDate, int getPrice)
    {
        loan = new Loan(id, date, periode, status, serialNumber, getDate, getPrice);
        loans.add(loan);
        return loans;
    }

}
